<template>
  <body>
  <v-indexTop1></v-indexTop1>
  <div class="res-page">
  <div class="page-content">
      <div style="left: 50px">
        <strong><a href="javascript:;">中文简历
        <i class="el-icon-edit-outline"></i>
      </a></strong>
      </div>
    <div class="resume-complete">
      <div class="green-bg" style="width: 85%;">
      </div><div class="percent">完整度85%</div>
    </div >
    <div class="resume-operate"><a href="javascript:;">预览</a><i class="fot">|</i>
      <a href="javascript:;" @click="Refresh">刷新</a>
      <a class="btn-optimize-resume" href="javascript:;" @click="to_bres">
        <span style="color: white; font-size: 14px">优化简历</span></a>
      </div>
  </div>
    <div class="card-wrap">
      <div class="card-main">
        <div class="card-left">
          <img  :src="imgurl" alt="头像" style="width: 120px;height: 120px" v-if="img_url">
          <img  :src="imgs.touxiang2" alt="头像" style="width: 120px;height: 120px" v-else >
          <el-upload
                name="resumeFile"
                class="upload-demo"
                action="api/upload_img"
                :on-preview="handlePreview"
                :on-remove="handleRemove"
                :on-success="fileSuccess"
                :before-remove="beforeRemove"
                multiple
                :limit="3"
                :on-exceed="handleExceed"
                :file-list="fileList"
          >
             <el-button size="small" type="primary">点击 修改头像</el-button>
          </el-upload>
        </div>
        <div class="card-right">
          <div ><span class="left-text">名称：{{user[0].user_name}}</span><span>&nbsp;显示：
            <el-radio  v-model="rou" label="1">{{user[0].user_name}}</el-radio>
            <el-radio  v-model="rou" label="2">
              <span v-if="resume[0].resume_age">{{user[0].user_name[0]}}女士</span>
              <span v-if="!(resume[0].resume_age)">{{user[0].user_name[0]}}先生</span>
            </el-radio>
          </span>
          </div>

          <div><span class="left-text">性别：
            <el-radio  v-model="age" label= '0'>男</el-radio>
            <el-radio  v-model="age" label= '1'>女</el-radio></span></div>
          <br>
          <div><span class="left-text" style="left: -25%">参加工作的年份：{{works[0].We_ResignTime}}</span></div>
          <br>
          <div><span class="left-text">城市：{{resume[0].resume_census}}</span></div>
        </div>
      </div>
    </div>
    <div class="res-wrap">
      <dt class="res-title">
        <i class="el-icon-tickets"></i>基本资料
        <em class="tips-required">必填<i></i></em>
      </dt>
      <br>
      <div class="resume-completes">
        <table class="resume-table">
          <tbody>
          <tr>
            <th>出生日期：</th>
            <td>{{resume[0].resume_birthday}}</td>
            <th>手机：</th>
            <td>{{this.$session.get('userPhone')}}</td>
          </tr><tr>
            <th>邮箱：</th>
            <td>{{user[0].user_mail}}</td>
            <th>国籍：</th>
            <td>中国</td>
          </tr><tr>
            <th>户   口：</th>
            <td>{{resume[0].resume_census}}</td>
            <th>政治面貌：</th>
            <td>共青团员</td>
          </tr><tr>
            <th>状态：</th>
            <td>{{resume[0].resume_state}}</td>
          </tr>
          </tbody>
        </table>
      </div>
      <hr>
      <dt class="res-title">
        <i class="el-icon-sold-out"></i>职业意向
        <em class="tips-required">必填<i></i></em>
      </dt>
      <div class="resume-completes resume-jobwant-wrap">
        <table>
          <tbody>
          <tr>
            <th>期望行业 : </th>
            <td>{{resume[0].resume_hope_industry}}</td>
          </tr>
          <tr>
            <th>期望职能 : </th>
            <td>{{resume[0].resume_hope_position}}</td>
          </tr>
          <tr>
            <th>期望地点 : </th>
            <td>{{resume[0].resume_hope_location}}</td>
          </tr>
          <tr>
            <th>期望薪资 : </th>
            <td>{{resume[0].resume_hope_annuity}}</td>
          </tr>
          </tbody>
        </table>
      </div>
      <hr>
      <dt class="res-title title-s">
        <i class="el-icon-menu"></i>教育经历
        <em class="tips-required">必填<i></i></em>
      </dt>
      <br>
      <div class="resume-completes school-s">
        <dl><img :src="imgs.shcool" alt=""></dl>
        <dd>
          <div>
          <strong>{{resume[0].resume_School}}</strong>&nbsp;(毕业时间：{{resume[0].resume_GraduationTime}})
          </div>
          <p class="resume-edu">本科  |  {{resume[0].resume_professional}}</p>
          <p ><span>统招</span></p>
        </dd>
      </div>
      <hr>
      <dt class="res-title title-s">
        <i class="el-icon-date"></i>工作经历
        <em class="tips-required">必填<i></i></em>
      </dt>
      <div class="res-work" v-for="work in works ">
        <h1 class="work-name">
        <span class="job-name"> {{work.We_PositionName}}</span>| &nbsp;<span>{{work.We_CompanyName}}</span>
        <time class="experience-time">{{work.We_ResignTime}} - {{work.We_EntryTime}}</time>
        </h1>
        <div class="work-text">
          <div style="margin: 19px 0 15px;">
            <span>工作地点：{{work.We_location}}</span>
            <span>&nbsp;| &nbsp;</span>
            <span>下属人数：{{work.We_Number}}</span></div>
          <br><br>
          <div><span>职责业绩：</span>
            <span>{{work.We_ResponsibilityTxt}}</span>
          </div>
          <br>
          <hr>
          <div><span style="color: #999">公司行业：</span><span style="color: #999">{{work.We_CompanyIndustry}}</span></div>
        </div>
      </div>

    </div>
  </div>

  </body>
</template>

<script>
  import indexTop1 from '../assemblyPublic/Index-top1'
    export default {
      name: "resumeDisplay",
      data() {
        return {
          fileList: [],
          age: '1',
          rou: '1',
          user: '',
          min_work_time: '',
          resume: '',
          works: '',
          img_url:'',
          imgs: {
            touxiang2: require('../../assets/img/touxiang2.png'),
            // touxiang2: require('F:/学习课件/实训/super-application/SPI_Django/media/刘涛3/img/HeadPortrait.jpg'),
            shcool: require('../../assets/img/shcool.png'),
          }
        }
      },
      mounted: function () {
        this.sta();
      },
      methods: {
        Refresh(){
          location.reload();
        },
        handleExceed(files, fileList) {
          this.$message.warning(
            `当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${
              files.length + fileList.length
            } 个文件`
          );
        },
        // 简历上传
        handleRemove(file, fileList) {
          // console.log(file, fileList);
        },
        handlePreview(file) {
          // console.log(file);
        },
        beforeRemove(file, fileList) {
          return this.$confirm(`确定移除 ${file.name}？`);
        },
        fileSuccess() {
          console.log(this.fileList);
        },
        to_bres() {
          this.$router.push({
            path: '/resumeShow'
          })
        },
        sta() {
          console.log(this.$session.get('userPhone'));
          this.$axios({
            method: 'POST',
            url: 'api/res_display',
            data: {
              phone_num: this.$session.get('userPhone')
            },
          }).then((data) => {
            console.log(data.data);
            if (data.data.res_case == 'ok') {
              this.user = data.data.user;
              this.works = data.data.works;
              this.resume = data.data.resume_list;
              if (this.resume[0].resume_age) {
                this.age = '1'
              } else {
                this.age = '0'
              };
              if (data.data.resume_list[0].resume_avatar_url =='#'){
                this.img_url = false
              }else {
                this.img_url = true
              }

            } else {
              alert('加载有误！！')
            }
          })
        },
      },
      computed: {
        imgurl: function () {
          return require('../../../../SPI_Django/media/' + String(this.user[0].id) + '/img/HeadPortrait.jpg')
        }
      },
      components: {
        "v-indexTop1": indexTop1,
      }
    }
</script>

<style scoped>

</style>
